import request from '@/utils/request';

// 查询团购活动列表
export function listGroupon(query) {
	return request({
		url: '/mall/groupon/list',
		method: 'post',
		data: query,
	});
}

// 查询团购活动详细
export function getGroupon(id) {
	return request({
		url: '/mall/groupon/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增团购活动
export function addGroupon(data) {
	return request({
		url: '/mall/groupon/add',
		method: 'post',
		data: data,
	});
}

// 编辑团购活动
export function updateGroupon(data) {
	return request({
		url: '/mall/groupon/edit',
		method: 'post',
		data: data,
	});
}

// 删除团购活动
export function delGroupon(id) {
	return request({
		url: '/mall/groupon/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出团购活动
export function exportGroupon(query) {
	return request({
		url: '/mall/groupon/export',
		method: 'post',
		params: query,
	});
}
